<script setup>
import ProcessTree from "@/views/wflow/design/process/ProcessTree.vue";
import {ref} from "vue";

//测试的流程数据
const config = ref([
  {
    id: 'node_00000',
    type: 'ROOT',
    name: '发起人',
    parentId: null,
    childId: null,
    props: {}
  },
  {
    id: 'node_002220',
    type: 'APPROVAL',
    name: '审批人',
    parentId: 'node_00000',
    childId: null,
    props: {}
  },
  {
    id: 'node_009920',
    type: 'GATEWAY',
    name: '审批人',
    parentId: 'node_002220',
    childId: null,
    props: {},
    branch: [
      [
        {
          id: 'node_00000',
          type: 'EXCLUSIVE',
          name: '条件1',
          parentId: null,
          props: {}
        },
        {
          id: 'node_00000',
          type: 'APPROVAL',
          name: '发起人',
          parentId: null,
          props: {}
        }
      ],
      [
        {
          id: 'node_00000',
          type: 'EXCLUSIVE',
          name: '条件3',
          parentId: null,
          props: {}
        },
        {
          id: 'node_00000',
          type: 'APPROVAL',
          name: '发起人',
          parentId: null,
          props: {}
        },
        {
          id: 'node_00000',
          type: 'APPROVAL',
          name: '发起人',
          parentId: null,
          props: {}
        }
      ],
      [
        {
          id: 'node_00000',
          type: 'EXCLUSIVE',
          name: '条件1',
          parentId: null,
          props: {}
        },
        {
          id: 'node_00000',
          type: 'APPROVAL',
          name: '发起人',
          parentId: null,
          props: {}
        },
        {
          id: 'node_00000',
          type: 'APPROVAL',
          name: '发起人',
          parentId: null,
          props: {}
        }
      ]
    ]
  },
])
</script>

<template>
  <div class="app">
    <process-tree :config="config"/>
  </div>
</template>

<style scoped>
.app {
  width: 100%;
  padding: 20px;
  min-height: 100vh;
  background: #F5F6F6;
}
</style>
